
import Taro, {Component} from '@tarojs/taro'
import {View, Image} from '@tarojs/components'

import './applySuccess.less'

import icon_08 from '../../assets/img/icon_08.png'
import iconAddress from '../../assets/img/icon_address.png'
import {getRuntime} from "../../utils/common";

class ApplySuccess extends Component {
  componentWillMount() {
    Taro.setNavigationBarTitle({title: '申请成功'})
  }

  link(url: string = '/pages/index/index'): void {
    getRuntime().navigateTo(url)
  }

  render() {
    let info = getRuntime().getStorage('applyTaxInfo')
    return (
      <View className='pay-success'>
         <View className='pay__header'>
            <Image src={icon_08} className='pay-icon' />
            <View className='pay__title'>申请成功</View>
            <View className='pay__desc color-theme'>
              <View className='color-theme'>我们会尽快为您快递纸质税票</View>
              <View className='color-theme'>请耐心等待哦~</View>
            </View>
         </View>
          <View className='interval' />

          <View className='address-list'>
            <View className='address-list__item'>
              <Image className='address-list__icon' src={iconAddress} />
              <View className='address-list__info'>
                <View className='address-list__title f30'>{info.receiver} {info.receiverPhone}</View>
                <View className='address-list__address f24 font-dark'>{info.receiverAddress}</View>
              </View>
            </View>
          </View>

          <View className='btn-two-wrap'>
            <View className='btn btn-active' onClick={this.link.bind(this,'/pages/order/index')}>查看订单</View>
            <View className='btn' onClick={this.link.bind(this,'/pages/index/index')}>返回首页</View>
          </View>
      </View>
    )
  }
}

export default ApplySuccess
